local dianluan = fk.CreateSkill{
  name = "rfenghou_3d17j__dianluan",
}

dianluan:addEffect("active", {
  prompt = function(self, player)
    return "#rfenghou_3d17j__dianluan-" .. (player.faceup and "down" or "up")
  end,
  can_use = function(self, player)
    return not table.contains(player:getTableMark("_rfenghou_3d17j__dianluan-phase"), player.faceup and "down" or "up")
  end,
  card_num = 0,
  card_filter = Util.FalseFunc,
  target_num = 0,
  target_filter = Util.FalseFunc,
  on_use = function(self, room, use)
    local player = use.from
    local choice = player.faceup and "down" or "up"
    room:addTableMark(player, "_rfenghou_3d17j__dianluan-phase", choice)
    player:turnOver()
    if choice == "up" then
      room:loseHp(player, 1, dianluan.name)
    else
      room:recover{
        who = player,
        num = 1,
        recoverBy = player,
        skillName = dianluan.name
      }
    end
  end
})

Fk:loadTranslationTable{
  ["rfenghou_3d17j__dianluan"] = "颠鸾",
  [":rfenghou_3d17j__dianluan"] = "出牌阶段各限一次，你可将你的武将牌翻至背面/正面，然后回复/失去1点体力。",

  ["#rfenghou_3d17j__dianluan-up"] = "颠鸾：将你的武将牌翻至正面，然后失去1点体力。",
  ["#rfenghou_3d17j__dianluan-down"] = "颠鸾：将你的武将牌翻至背面，然后回复1点体力。",
}

return dianluan
